package com.期末小游戏;



import java.awt.*;

public class Enemy {
    //定义图片
    Image img;
    //定义物体坐标
    int x;
    int y;
    int width;
    int height;
    //移动速度
    int speed;
    //方向
    int dir = 1;
    //类型
    int type;
    //分值
    int count;
    //绘制自身的方法
    public void painSelf(Graphics g){
        g.drawImage(img,x,y,width,height,null);
    }
    //获取自身矩形用于碰撞检测
    public Rectangle getRec(){
        return new Rectangle(x,y,width,height);
    }
}
//敌方鱼左类
class Enemy_1_L extends Enemy{
    Enemy_1_L(){
        this.x=-57;
        this.y=(int)(Math.random()*700+100);
        this.width=80;
        this.height=45;
        this.speed=5;
        this.count=1;
        this.type=1;
        this.img=GameUtils.enemyl_img;
    }
}
class Enemy_1_R extends Enemy_1_L{
    Enemy_1_R(){
        this.x=1400;
        dir=-1;
        this.img=GameUtils.enemyr_img;
    }
}
//定义第二类鱼
class Enemy_2_L extends Enemy{
    Enemy_2_L(){
        this.x=-100;
        this.y=(int)(Math.random()*700+100);
        this.width=100;
        this.height=65;
        this.speed=5;
        this.count=2;
        this.type=2;
        this.img=GameUtils.enemyl_2img;
    }
}
class Enemy_2_R extends Enemy_2_L{
    Enemy_2_R(){
        this.x=1400;
        dir=-1;
        this.img=GameUtils.enemyr_2img;
    }
}
//定义第三类鱼
class Enemy_3_L extends Enemy{
    Enemy_3_L(){
        this.x=-300;
        this.y=(int)(Math.random()*700+100);
        this.width=250;
        this.height=150;
        this.speed=7;
        this.count=4;
        this.type=4;
        this.img=GameUtils.enemyl_3img;
    }
}
class Enemy_3_R extends Enemy_3_L{
    Enemy_3_R(){
        this.x=1400;
        dir=-1;
        this.img=GameUtils.enemyr_3img;
    }
}

//定义BOSS类
class Enemy_Boss extends Enemy{
    Enemy_Boss(){
        this.x=-1000;
        this.y=(int)(Math.random()*700+100);
        this.width=400;
        this.height=280;
        this.speed=18;
        this.type=10;
        this.count=0;
        this.img=GameUtils.bossimg;
    }
}




